#include "other_headers/qromb2d_t.h"
//Functions for calculating the volume of intersection of sphere and cylinder
// sphr : the radius of   sphere
// cylr : the radius of   cylinder
// dcsphacyl : the distance from the center of the sphere to the axis of the cylinder
//reference: F. Lamarche and C. Leroy, Evaluation of the volume of intersection
//of a sphere with a cylinder by elliptic integrals, Computer Phys. Comm. 59 (1990) 359-369.
double Cyl_Sphere_Intersection(double cylr, double sphr,double dcsphacyl){

	double Intersection;
	sphr=1;cylr=1;dcsphacyl=1;
	Ftor func(sphr);
	Fty1 lymin;
	Fty2 lymax(cylr,sphr,dcsphacyl);
	Intersection=4*quad2d_t(func, GetMax(dcsphacyl-cylr,-sphr), GetMin(dcsphacyl+cylr,sphr),lymin, lymax);

return Intersection;
}


//---------------------------------------------------------------------------
